import { useStore } from '@/store';

export function usePermission(
  moduleName: string,
  pageName: string,
  hanlderName: string
): boolean {
  const store = useStore();
  const permission = store.state.login.permission;
  const verifyPermission = `${moduleName}:${pageName}:${hanlderName}`;
  return !!permission.find((item) => item === verifyPermission);
}
